'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index () {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async castScreen () {
    const { ctx } = this;
    await ctx.render('castScreen/index.html');
  }
  async io () {
    const { ctx } = this;
    await ctx.render('castScreen/io.html');
  }
  async test () {
    this.ctx.body = 'success';

  }
  async saveScreenCapture () {
    this.ctx.body = await this.service.castScreen.saveImg();
  }
  async saveBase64ScreenCapture () {
    this.ctx.body = await this.service.castScreen.saveImgBase64();
  }
}

module.exports = HomeController;
